package com.bootdo.clouddoES.controller;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Slf4j
@Component
public class DeadLetterConsumer {
    private static Logger logger = LoggerFactory.getLogger(DeadLetterConsumer.class);
    @RabbitListener(queues = "QD")
    public void receiveD(Message message){
        String msg = new String(message.getBody());
        logger.info("当前时间{}，收到死信队列的消息：{}", new Date(), msg);
    }
}
